//用户接口
var urlHead = "http://10.141.31.239/Usersmanage";
//var urlHead = "http://10.139.23.100:8080/Usersmanage";//zfc
//var urlHead = "http://10.139.59.116:8080/Usersmanage";//hyp
//var urlHead = "http://10.139.24.16:8080/Usersmanage";//pjh

//产品接口
//var urlHead1 = "http://10.141.31.239/Products" 
var urlHead1 = "http://10.139.23.100:10012/Products";

//兑换的接口
// var urlHead2 = "http://10.141.31.239/Exchange";
var urlHead2 = "http://10.139.23.100:10013/Exchange";//zfc
// var urlHead2 = "http://10.139.24.16:10013/Exchange";//pjh1
//var urlHead2 = "http://10.137.241.88:10013/Exchange";//pjh2
// var urlHead2 = "http://10.139.7.55:10013/Exchange";//xmh


//md5加密盐值
var g_passsword_salt = "1a2b3c4d123";

layui.use('layer',function(){
	var layer = layui.layer;
});

//根据code提示msg
function showMsg(code,msg){
	//通用异常码
	if(code==500100){//服务端异常
		layer.msg(msg,{icon:5});
	}else if(code==500222){//用户不存在
		layer.msg(msg,{icon:5});
	}
	//登录注册模块异常码
	else if(code==500213){//手机号格式错误
		layer.msg(msg,{icon:5});
	}else if(code==500214){//手机号不存在
		layer.msg(msg,{icon:5});
	}else if(code==500215){//手机号已被注册
		layer.msg(msg,{icon:5});
	}else if(code==500216){//密码错误
		layer.msg(msg,{icon:5});
	}else if(code==500229){//注册失败
		layer.msg(msg,{icon:5});
	}else if(code==500230){//邮箱验证失败
		layer.msg(msg,{icon:5});
	}else if(code==500231){//邮箱发送失败
		layer.msg(msg,{icon:5});
	}else if(code==500232){//验证码输出错误
		layer.msg(msg,{icon:5});
	}else if(code==500233){//邮箱不存在
		layer.msg(msg,{icon:5});
	}
	//用户修改模块异常码
	else if(code==500602){//密码修改失败
		layer.msg(msg,{icon:5});
	}else if(code==500604){//电话修改失败
		layer.msg(msg,{icon:5});
	}else if(code==500606){//昵称修改失败
		layer.msg(msg,{icon:5});
	}else if(code==500608){//头像修改失败
		layer.msg(msg,{icon:5});
	}else if(code==500610){//邮箱修改失败
		layer.msg(msg,{icon:5});
	}else if(code==500618){//身份证修改失败
		layer.msg(msg,{icon:5});
	}else if(code==500624){//银行卡修改失败
		layer.msg(msg,{icon:5});
	}else if(code==500625){//新旧密码重复
		layer.msg(msg,{icon:5});
	}
	//token
	else if(code==600602){//用户未登录
		layer.msg(msg,{icon:5});
	}else if(code==600603){//Token过期
		layer.msg(msg,{icon:5});
	}
}

//根据参数进行页面跳转
function webpageRedirection(roleType){
	if(roleType==100){//普通用户
		location.href = "user_register1.html";
	}else if(roleType==101){//超级管理员
		location.href = "user_register2.html";
	}else if(roleType==102){//标签设置员
		location.href = "user_register3.html";
	}else if(roleType==103){//规则设置员
		location.href = "user_register1.html";
	}else if(roleType==104){//审核员
		location.href = "user_register2.html";
	}else if(roleType==105){//录入员
		location.href = "user_register3.html";
	}else if(roleType==106){//角色设置员
		location.href = "user_register1.html";
	}else if(roleType==107){//角色审核员
		location.href = "user_register2.html";
	}
}

